package org.example.elm_xiangmu.controller;


import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.example.elm_xiangmu.po.FoodType;
import org.example.elm_xiangmu.result.Result;
import org.example.elm_xiangmu.service.FoodTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/FoodType")
@Tag(name="点餐分类")
public class FoodTypeController {
    @Autowired
    FoodTypeService foodTypeService;
    @GetMapping("/listAll")
    @Operation(summary = "查看全部的点餐分类")
    public Result listAll(){
        List<FoodType> foodTypesList =foodTypeService.listAll();
        return Result.success(foodTypesList,"查询点餐分类成功");
    }
}
